package com.itHsuSE.demo4;

public class Check {
    public static void main(String str[]) {
        System.out.println(BBB.num);
    }
}

class Test {
    Sample sam1 = new Sample("sam1 成员初始化");//
    static Sample sam = new Sample("静态成员 sam 初始化 ");//

    static {
        System.out.println("static 块执行");//
        if (sam == null) System.out.println("sam is null");
    }

    Test()//构造器
    {
        System.out.println("Test 默认构造函数被调用");//
        System.out.println();
    }
}

class Sample {
    Sample(String s) {
        System.out.println(s);
    }

    Sample() {
        System.out.println("Sample 默认构造函数被调用");
    }
}

class BBB {
    public final static int num = 10000;

    static {
        System.out.println("BBB 静态代码块被执行");
    }
}